package com.leyou.common.exception;

import com.leyou.common.enums.ExceptionEnum;
import lombok.Getter;

/**
 * 异常类
 */
@Getter
public class LyException extends RuntimeException{

    private Integer status; // 状态码

    public LyException(Integer status, String message){
        super(message);
        this.status = status;// 状态码
    }

    /**
     * 处理枚举信息
     * @param enums
     */
    public LyException(ExceptionEnum enums) {
        super(enums.getMessage());
        this.status = enums.getStatus();
    }
}
